<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body id="body">

<div id="console"></div>

<script>

    if (window.internals)
        internals.enableMockSpeechSynthesizer(window);

    description("This tests that there isn't a crash if the utterance object is garbage-collected before speaking finishes.");

    if (window.testRunner)
        testRunner.waitUntilDone();

    window.jsTestIsAsync = true;

    speechSynthesis.speak(new SpeechSynthesisUtterance(" "));
    gc();

    window.setInterval(function() {
       if (!speechSynthesis.speaking)
           finishJSTest();
    }, 10);

</script>

</body>
</html>
